package com.jxpowernode.bitcon.service.douyinservice;

import com.alibaba.fastjson.JSONObject;
import com.jxpowernode.bitcon.Constants;
import com.jxpowernode.bitcon.bean.douyin.GameVideo;
import com.jxpowernode.bitcon.bean.douyin.GameVideoCommon;
import com.jxpowernode.bitcon.request.HttpUtils;

import java.util.List;

/**
 * @Author: Lixuewei
 * @Email:1410511702@qq.com
 * @Desc: 该类用于对游戏达人的封装
 * @Date: 2021/12/7 18:44
 */
public class GameVideoService {

    /**
     * 该方法用于获取游戏达人数据，并将美食达人数据返回
     * @return
     */
    public List<GameVideo> getGameVideo(){
        String url = Constants.TRIP_URL
                + "?key=" + Constants.TRIP_KEY
                + "&type=game_console"
                + "&size=5";
        String result = HttpUtils.get(url);
        //json解析
        GameVideoCommon common = JSONObject.parseObject(result, GameVideoCommon.class);
        return common.result;
    }
}
